//
// Created by mac on 1/26/22.
//

#include <string>
using namespace std;

bool isVowel(char c);

string reverseVowels(string s) {
   int left = 0;
   int right = s.size();

   while (left<right){
       while (left < right && !isVowel(s[left])) left++;
       while (left < right && !isVowel(s[right])) right--;
       if(left>right){
           break;
       }

       swap(s[left], s[right]);

       left++;
       right--;
   }

    return s;

}

bool isVowel(char c) {
    return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'
           || c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U';
}